package com.shujia.day08.ketang;

/*
        不同地方饮食文化不同的案例
        Person
            eat()
        SouthPerson
            eat()
        NorthPerson
            eat()


 */
class Person{
    public void eat(){
        System.out.println("吃");
    }
}

class SouthPerson extends Person{
    @Override
    public void eat() {
        System.out.println("南方人吃🍚");
    }

    public void daMaJiang(){
        System.out.println("南方人喜欢打麻将");
    }
}

class NorthPerson extends Person{
    @Override
    public void eat() {
        System.out.println("北方人是🍜");
    }

    public void shuaiJiao(){
        System.out.println("北方人喜欢🤼‍");
    }
}


public class DuoTaiTest {
    public static void main(String[] args) {
        Person p1 = new SouthPerson();
        p1.eat();
//        p1.daMaJiang();
        System.out.println("-------------------");
        SouthPerson sp = (SouthPerson) p1;
        sp.eat();
        sp.daMaJiang();
    }
}
